Imports DotNetNuke.UI.WebControls
Imports System.Data

Partial Class DNNTextSuggest
	Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

	'This call is required by the Web Form Designer.
	<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

	End Sub

	'NOTE: The following placeholder declaration is required by the Web Form Designer.
	'Do not delete or move it.
	Private designerPlaceholderDeclaration As System.Object

	Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
		'CODEGEN: This method call is required by the Web Form Designer
		'Do not modify it using the code editor.
		InitializeComponent()
	End Sub

#End Region

	Protected Overrides Sub OnInit(ByVal e As System.EventArgs)
		MyBase.OnInit(e)
		DotNetNuke.UI.Utilities.ClientAPI.HandleClientAPICallbackEvent(Me)
	End Sub

	Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
		'Put user code to initialize the page here

		Me.MyDNNTextSuggest.Delimiter = Me.txtDelimiter.Text
		Me.MyDNNTextSuggest.ForceDownLevel = Me.chkForceDownLevel.Checked
		Me.MyDNNTextSuggest.IDToken = CInt(Me.cboIDToken.SelectedValue)

		If IsNumeric(Me.txtMinChars.Text) Then Me.MyDNNTextSuggest.MinCharacterLookup = CInt(Me.txtMinChars.Text)
		If IsNumeric(Me.txtMaxRows.Text) Then Me.MyDNNTextSuggest.MaxSuggestRows = CInt(Me.txtMaxRows.Text)
		If IsNumeric(Me.txtLookupDelay.Text) Then Me.MyDNNTextSuggest.LookupDelay = CInt(Me.txtLookupDelay.Text)
		If IsNumeric(Me.txtLostFocusDelay.Text) Then Me.MyDNNTextSuggest.LostFocusDelay = CInt(Me.txtLostFocusDelay.Text)
		Me.MyDNNTextSuggest.CaseSensitive = Me.chkCaseSensitive.Checked

		Dim sb As System.Text.StringBuilder = New System.Text.StringBuilder
		For Each objNode As DNNNode In Me.MyDNNTextSuggest.SelectedNodes
			sb.Append("Text:" & objNode.Text & "<BR>")
			sb.Append("Key:" & objNode.Key & "<BR>")
			sb.Append("<hr>")
		Next
		lblEventDetails.Text = sb.ToString
	End Sub

    Private Sub MyDNNTextSuggest_PopulateOnDemand(ByVal source As Object, ByVal e As DotNetNuke.UI.WebControls.DNNTextSuggestEventArgs) Handles MyDNNTextSuggest.PopulateOnDemand
        DataServices.PopulateList(e.Nodes, e.Text, MyDNNTextSuggest.MaxSuggestRows, MyDNNTextSuggest.CaseSensitive)
    End Sub


	Private Sub MyDNNTextSuggest_NodeClick(ByVal source As Object, ByVal e As DNNTextSuggestEventArgs) Handles MyDNNTextSuggest.NodeClick
        Dim nodeInfo As String = ""
		nodeInfo &= "<b>Node ID:  </b>"
		nodeInfo &= e.Text & "<br>"

		lblEventDetails.Text = nodeInfo
	End Sub



	Private Sub btnPostBack_ServerClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPostBack.ServerClick

	End Sub

	Private Sub chkCaseSensitive_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkCaseSensitive.CheckedChanged

	End Sub

	Private Sub txtLostFocusDelay_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtLostFocusDelay.TextChanged

	End Sub
End Class
